package com.flex.core.model;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * model的父类，定义了model中的ID字段，主键，自增长，此类需要model继承后才可以使用
 * 
 * @author radio
 * 
 */
@MappedSuperclass
public abstract class AbstractIdEntity {

	private static final long serialVersionUID = 3303054758723102256L;

	protected Long id;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}
